home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @@;
-
-
- 1.2
- date 89.10.09.21.28.25; author rab; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 89.01.09.10.56.35; author ouster; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.2
- log
- @Modifications for distribution.
- @
- text
- @#!/sprite/cmds/csh -f
- #
- # A script to generate (or regenerate) the Makefile for a directory
- # consisting solely of header files.
- #
- # We assume we were invoked from mkmf. Parameters passed in from mkmf
- # through environment variables:
- #
- # MKMFDIR directory containing prototype makefiles
- # MAKEFILE name of makefile to create
- # SUBTYPE additional information, telling whether this
- # is an X directory, Sprite directory, etc.
- #
-
- #
- # Argument processing. (Generalized form, even though just one flag so far.)
- #
- while ($#argv >= 1)
- if ("$1" == '-x') then
- set echo
- endif
- shift
- end
-
- set name=`expr $cwd : '.*/man/\(.*\)$'`
- set subtype=$SUBTYPE
- set makefile=$MAKEFILE
- set distdir=($DISTDIR)
-
- if (-e $makefile.proto) then
- set proto=$makefile.proto
- else
- set proto="${MKMFDIR}/Makefile.man"
- endif
-
- echo "Generating a Makefile for $name manual entries using $proto"
-
- set nonomatch
- set manPages =( *.man )
- #
- # Check to see if there were any man pages. The first check (size == 1)
- # is only necessary because the second check will cause an error if
- # hdrs contains more than 1024 bytes.
- #
- if ($#manPages == 1) then
- if ("$manPages" == "*.man") set manPages=()
- endif
- unset nonomatch
-
- #
- # Use sed to substitute various interesting things into the prototype
- # makefile. The code below is a bit tricky because some of the variables
- # being substituted in can be very long: if the substitution is passed
- # to sed with "-e", the entire variable must fit in a single shell argument,
- # with a limit of 1024 characters. By generating a separate script file
- # for the very long variables, the variables get passed through (to the
- # script file) as many arguments, which gets around the length problem.
- #
-
- rm -f mkmf.tmp.sed
- echo s,"@@(MANPAGES)",$manPages,g > mkmf.tmp.sed
- cat $proto | sed -f mkmf.tmp.sed \
- -e "s,@@(DATE),`date`,g" \
- -e "s,@@(MAKEFILE),$makefile,g" \
- -e "s,@@(NAME),$name,g" \
- -e "s,@@(TEMPLATE),$proto,g" \
- -e "s,@@(TYPE),$subtype,g" \
- -e "s,@@(DISTDIR),$distdir,g" \
- > $makefile
- rm -f mkmf.tmp.sed
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d28 1
- d68 1
- @
-